package cn.tedu.spring;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

//Property属性
//classpath特指resources文件
@Component
//@PropertySource("classpath:jdbc.properties")//作用:读取配置信息
public class JdbcConfig {
    @Value("${spring.jdbc.url}")
    private String url;
    @Value("${spring.jdbc.driver}")
    private String driver;
    @Value("${spring.jdbc.username}")
    private String username;
    @Value("${spring.jdbc.password}")
    private String password;
    @Value("${spring.jdbc.init-size}")
    private int init_size;
    @Value("${spring.jdbc.max-active}")
    private int max_active;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getInit_size() {
        return init_size;
    }

    public void setInit_size(int init_size) {
        this.init_size = init_size;
    }

    public int getMax_active() {
        return max_active;
    }

    public void setMax_active(int max_active) {
        this.max_active = max_active;
    }
}